iT邦幫忙

2023 iThome 鐵人賽

DAY 29
0
Mobile Development

SwiftUI 男孩系列 第 29

Day 29: Azure Active Directory

  • 分享至 

  • xImage
  •  

https://ithelp.ithome.com.tw/upload/images/20231012/20130138MXk4Yak4RF.jpg
Photo by Dan Freeman on Unsplash
Auckland, New Zealand
Auckland 的港口,有不少提供燭光晚餐的餐廳。


https://github.com/AzureAD/microsoft-authentication-library-for-objc

Tutorial: Create an iOS or macOS app that uses the Microsoft identity platform for authentication - Microsoft Entra

反正我從 iOS MSAL tutorial 理解,唯一處理 issue 在登出,要 clear All Account Caches。

func clearAllAccountCaches() {

        let pcaConfig = MSALPublicClientApplicationConfig(clientId: ClientID)
        guard let application = try? MSALPublicClientApplication(configuration: pcaConfig) else {
            return
        }

        let accounts = try? application.allAccounts()

        if let allAccounts = accounts {
            for account in allAccounts {
                do {
                    try application.remove(account)
                } catch {
                    print("Failed to remove account: \(error)")
                }
            }
            print("All accounts removed successfully")
        }
    }

上一篇
Day 28 加密解密
下一篇
Day 30 : Recap
系列文
SwiftUI 男孩30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言